<!-- descriptions-->
<div id="collection-page" class="profile">
  <!-- /descriptions-->
  <!--subnavigation, sorting and actions-->
  <!--/subnav-->
  <!--main content-->
  <% request = (@challenge_assignment.request_signup || @challenge_assignment.pinch_request_signup) %>
  <h3>
    <% if request %>
      <%= ts("Assigned to %{requester}: %{offerer}", :requester => request.pseud.byline, :offerer => @challenge_assignment.offer_byline) %>
      <% if @challenge_assignment.collection.challenge.user_allowed_to_see_assignments?(current_user) %>
        <%= challenge_assignment_email(@challenge_assignment) %>
      <% end %>
    <% else %>
      No Assignment
    <% end %>
  </h3>

  <div class="collection preface">
    <% if request %>
      <h3><%=h t("challenge_assignments.requests_for", :default => "Requests by %{requester}", :requester => request.pseud.byline) %></h3>
      <%= render :partial => "challenge_signups/show_requests", :locals => {:challenge_signup => request} %>
    <% else %>
      <p class="note">No request!</p>
      <p class="note">Contact challenge moderators for help.</p>
    <% end %>
    
    <% if @challenge_assignment.offer_signup %>
      <h3><%=h t("challenge_assignments.offers_for", :default => "Offers from %{offerer}", :offerer => @challenge_assignment.offer_byline) %></h3>
      <%= render :partial => "challenge_signups/show_offers", :locals => {:challenge_signup => @challenge_assignment.offer_signup} %>
    <% elsif @challenge_assignment.pinch_hitter %>
      <p class="note">Pinch Hitter</p>
    <% else %>
      <p class="note">No assigned giver!</p>
      <p class="note">Contact challenge moderators for help.</p>
    <% end %>
  </div>

  <!--/content-->
  <% if !@challenge_assignment.fulfilled? && @challenge_assignment.offering_pseud.user == current_user %>
    <ul class="navigation">
      <li>
        <%= link_to "Default", default_user_assignment_path(@challenge_assignment.offering_pseud.user, @challenge_assignment), 
            :confirm => "Are you sure? This will mark you as having defaulted and notify the collection maintainer! It cannot be undone." %>
      </li>
      <li><%= link_to t('.assignment.post_new', :default => "Post To Fulfill"), new_collection_work_path(@challenge_assignment.collection, :assignment_id => @challenge_assignment.id) %></li>
    </ul>
  <% end %>
  
</div>

